package com.neu.carbon.flights.service.impl;

import java.util.List;
import com.neu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.neu.carbon.flights.mapper.FlightsMapper;
import com.neu.carbon.flights.domain.Flights;
import com.neu.carbon.flights.service.IFlightsService;

/**
 * 飞行记录Service业务层处理
 * 
 * @author neuedu
 * @date 2025-08-22
 */
@Service
public class FlightsServiceImpl implements IFlightsService 
{
    @Autowired
    private FlightsMapper flightsMapper;

    /**
     * 查询飞行记录
     * 
     * @param id 飞行记录ID
     * @return 飞行记录
     */
    @Override
    public Flights selectFlightsById(Long id)
    {
        return flightsMapper.selectFlightsById(id);
    }

    /**
     * 查询飞行记录列表
     * 
     * @param flights 飞行记录
     * @return 飞行记录
     */
    @Override
    public List<Flights> selectFlightsList(Flights flights)
    {
        return flightsMapper.selectFlightsList(flights);
    }

    /**
     * 新增飞行记录
     * 
     * @param flights 飞行记录
     * @return 结果
     */
    @Override
    public int insertFlights(Flights flights)
    {
        flights.setCreateTime(DateUtils.getNowDate());
        return flightsMapper.insertFlights(flights);
    }

    /**
     * 修改飞行记录
     * 
     * @param flights 飞行记录
     * @return 结果
     */
    @Override
    public int updateFlights(Flights flights)
    {
        return flightsMapper.updateFlights(flights);
    }

    /**
     * 批量删除飞行记录
     * 
     * @param ids 需要删除的飞行记录ID
     * @return 结果
     */
    @Override
    public int deleteFlightsByIds(Long[] ids)
    {
        return flightsMapper.deleteFlightsByIds(ids);
    }

    /**
     * 删除飞行记录信息
     * 
     * @param id 飞行记录ID
     * @return 结果
     */
    @Override
    public int deleteFlightsById(Long id)
    {
        return flightsMapper.deleteFlightsById(id);
    }
}
